#include <stdio.h>
#include <string.h>

int main(void)
{
    char str[5000] = {0};
    int  len = 0, cnt = 0, pos = 0;

    scanf("%[^\n]", str);
    
    len = strlen(str);
    pos = len - 1;

    while (pos >= 0)
    {
        pos--;
        cnt++;

        if (str[pos] == ' ')
            break;
    }

    printf("%d", cnt);
    return 0;
}